package com.b2bpsssm.controller.material.commodity;


import com.b2bpsssm.common.R;
import com.b2bpsssm.pojo.CommodityClassification;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Api(value = "商品分类页面",tags = "商品分类接口Api")
public class CommodityClassificationController {
    /*
     * 商品分类父类查询
     * */
    @RequestMapping(value = "/commodity/queryCommodityClassificationParId",method = RequestMethod.GET)
    @ApiOperation(value = "查询商品一级分类",notes = "直接显示一级商品分类",httpMethod = "get",response = R.class)
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "page",value = "当前页码",required = true),
//            @ApiImplicitParam(name = "limit",value = "每页条数",required = true)
//    })
    @ResponseBody
    public R queryCommodityClassificationParId(){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 查询商品二级分类
     * */
    @RequestMapping(value = "/commodity/queryCommodityClassificationProIDbyParId",method = RequestMethod.GET)
    @ApiOperation(value = "查询商品二级分类",notes = "直接显示二级商品分类",httpMethod = "get",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "com_Cla_Par_Id",value = "父类ID",required = true),
    })
    @ResponseBody
    public R queryCommodityClassificationProIDbyParId(String comClaParId){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 新增分类
     * */
    @RequestMapping(value = "/commodity/addCommodityClassification",method = RequestMethod.POST)
    @ApiOperation(value = "新增商品分类",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "com_Cla_Pro_Id",value = "分类编码",required = true),
            @ApiImplicitParam(name = "com_Cla_Name",value = "分类名称",required = true),
            @ApiImplicitParam(name = "com_Cla_Par_Id",value = "父级编码",required = true),
    })
    @ResponseBody
    public R addCommodityClassification(CommodityClassification commodityClassification){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 删除商品分类
     * */
    @RequestMapping(value = "/commodity/delCommodityClassification",method = RequestMethod.POST)
    @ApiOperation(value = "新增商品分类",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "com_Cla_Name",value = "分类名称",required = true),
    })
    @ResponseBody
    public R delCommodityClassification(String comClaName){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 修改分类
     * */
    @RequestMapping(value = "/commodity/updateCommodityClassification",method = RequestMethod.POST)
    @ApiOperation(value = "修改商品分类",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "com_Cla_Pro_Id",value = "分类编码",required = true),
            @ApiImplicitParam(name = "com_Cla_Name",value = "分类名称",required = true),
            @ApiImplicitParam(name = "com_Cla_Par_Id",value = "父级编码",required = true),
    })
    @ResponseBody
    public R updateCommodityClassification(CommodityClassification commodityClassification){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }
}
